package bb.lanxing.lib.devices.core.provider;

import bb.lanxing.lib.devices.api.provider.BatteryProvider;
import bb.lanxing.lib.devices.api.provider.CadenceProvider;
import bb.lanxing.lib.devices.api.provider.DataProvider;
import bb.lanxing.lib.devices.api.provider.HeartRateProvider;
import bb.lanxing.lib.devices.api.provider.PowerRateProvider;
import bb.lanxing.lib.devices.api.provider.BikeTrainerProvider;
import bb.lanxing.lib.devices.api.provider.IndoorBikeProvider;
import bb.lanxing.lib.devices.api.provider.CrossTrainerProvider;
import bb.lanxing.lib.devices.api.provider.RowerProvider;
import bb.lanxing.lib.devices.api.provider.IndoorBikeDataDispatcher;
import bb.lanxing.lib.devices.api.provider.PressureProvider;
import bb.lanxing.lib.devices.api.provider.SpeedProvider;
import bb.lanxing.lib.devices.api.provider.TemperatureProvider;
import java.util.HashMap;
import java.util.Map;

public final class DataProviders {
    private static final Map<Class<?>, DataProvider> providers;

    static {
        HashMap hashMap = new HashMap();
        providers = hashMap;
        hashMap.put(CadenceProvider.class, new CadenceProviderImpl());
        hashMap.put(HeartRateProvider.class, new HeartRateProviderImpl());
        hashMap.put(PowerRateProvider.class, new PowerRateProviderImpl());
        hashMap.put(BikeTrainerProvider.class, new BikeTrainerProviderImpl());
        hashMap.put(IndoorBikeProvider.class, new IndoorBikeProviderImpl());
        hashMap.put(CrossTrainerProvider.class, new CrossTrainerProviderImpl());
        hashMap.put(RowerProvider.class, new RowerProviderImpl());
        hashMap.put(SpeedProvider.class, new SpeedProviderImpl());
        hashMap.put(PressureProvider.class, new PressureProviderImpl());
        hashMap.put(TemperatureProvider.class, new TemperatureProviderImpl());
        hashMap.put(IndoorBikeDataDispatcher.class, new IndoorBikeDataDispatcherImpl());
        hashMap.put(BatteryProvider.class, new BatteryProviderImpl());
    }

    public static CadenceProvider getCadenceProvider() {
        return (CadenceProvider) getProvider(CadenceProvider.class);
    }

    public static HeartRateProvider getHeartrateProvider() {
        return (HeartRateProvider) getProvider(HeartRateProvider.class);
    }
    public static PowerRateProvider getPowerrateProvider() {
        return (PowerRateProvider) getProvider(PowerRateProvider.class);
    }
    public static BikeTrainerProvider getBiketrainerProvider() {
        return (BikeTrainerProvider) getProvider(BikeTrainerProvider.class);
    }
    public static IndoorBikeProvider getIndoorbikeProvider() {
        return (IndoorBikeProvider) getProvider(IndoorBikeProvider.class);
    }

    public static CrossTrainerProvider getCrosstrainerProvider() {
        return (CrossTrainerProvider) getProvider(CrossTrainerProvider.class);
    }

    public static RowerProvider getRowerProvider() {
        return (RowerProvider) getProvider(RowerProvider.class);
    }
    public static BatteryProvider getBatteryProvider() {
        return (BatteryProvider) getProvider(BatteryProvider.class);
    }

    public static SpeedProvider getSpeedProvider() {
        return (SpeedProvider) getProvider(SpeedProvider.class);
    }

    public static IndoorBikeDataDispatcher getIndoorBikeDispatcher() {
        return (IndoorBikeDataDispatcher) getProvider(IndoorBikeDataDispatcher.class);
    }

    public static PressureProvider getPressureProvider() {
        return (PressureProvider) getProvider(PressureProvider.class);
    }

    public static TemperatureProvider getTemperatureProvider() {
        return (TemperatureProvider) getProvider(TemperatureProvider.class);
    }

    static <T extends DataProvider<E>, E> T getProvider(Class<? extends DataProvider<E>> cls) {
        return (T) providers.get(cls);
    }
}
